where to use javascript slice string method